package org.budo.jdbc.driver.statement.impl;

import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Map;

import org.budo.jdbc.driver.AbstractBudoJdbcPreparedStatement;
import org.budo.jdbc.driver.resultset.impl.MapArrayResultSet;
import org.budo.jdbc.driver.statement.AbstractJdbcStatement;
import org.budo.support.lang.util.MapUtil;

/**
 * SHOW engines
 * 
 * @author lmw
 */
public class SHOW_ENGINES extends AbstractJdbcStatement {
    @Override
    public void execute(PreparedStatement preparedStatement) throws SQLException{
        String[] columnNames = new String[] { "Engine", "Support", "Comment" };
        Map[] mapArray = new Map[] { MapUtil.stringMap("Engine", "InnoDB", "Support", "DEFAULT", "Comment", "comment-3") };
        ResultSet resultSet = new MapArrayResultSet(columnNames, mapArray);
        ((AbstractBudoJdbcPreparedStatement) preparedStatement).setResultSet(resultSet);
    }
}
